package com.gs.djys.checkfragments.soliciting;

import android.content.Context;

import com.alibaba.fastjson.JSON;
import com.gs.djys.Base.Urls;
import com.gs.djys.checkfragments.approval.ApprovalBean;
import com.gs.djys.mvp.BasePresenterImpl;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.model.Response;

import java.util.List;

/**
 * MVPPlugin
 *  邮箱 784787081@qq.com
 */

public class SolicitingPresenter extends BasePresenterImpl<SolicitingContract.View> implements SolicitingContract.Presenter{
    @Override
    public void getYJ(String req_no) {
        OkGo.<String>get(Urls.SERVER + "/road/lictran/licApp/findZqyjByReqNo")
                .params("req_no", req_no)
                .execute(new StringCallback() {
                    @Override
                    public void onSuccess(Response<String> response) {
                        SolicitingBean landBean = JSON.parseObject(response.body(),SolicitingBean.class);
                        if (mView == null)
                            return;
                        if (landBean.getCode().equals("0000")){
                            mView.getYJs(landBean);
                        }else {
                            mView.onRequestError(landBean.getMessage());
                        }
                    }
                });
    }
}
